home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_013 / pinwheel.bas < prev    next >
BASIC Source File  |  1992-05-06  |  3KB  |  75 lines

  1.  
  2. 10 rem downloaded from compuserve 10/29/85  REP
  3. 20 rem  [72746,1424]
  4. 30 rem PINWHE.BAS     27-Oct-85 2435              Accesses: 45
  5. 40 rem
  6. 50 rem    Keywords: GRAPHIC ANIMATION COLOR
  7. 60 rem
  8. 70 rem    A quick re-hack of a program originally done for the Tandy 2000.
  9. 80 rem    Manipulates the color registers to achieve spin of the pinwheels. Named
  10. 90 rem    Pinwheels.bas on my Amiga. Not as good as PolyScope, but fun none the less.
  11. 95 rem    -=DB=-
  12. 100    'PINWHEELS.BAS
  13. 110    RANDOMIZE
  14. 115    '******* Arrays to store rgb info from color registers
  15. 120    DIM red%(15),green%(15),blue%(15)
  16. 130    SCREEN 1,4,0
  17. 135    '******* Save the color registers
  18. 140    FOR register%=0 to 15
  19. 150    ASK RGB register%,r%,g%,b%
  20. 160    red%(register%)=r%:green%(register%)=g%:blue%(register%)=b%
  21. 170    NEXT register%
  22. 175    '******* Make the "dark" blue ABasiC background go away.
  23. 176    '******* Add ":RGB 2,0,0,0" to black the frame.
  24. 180    RGB 0,0,0,0
  25. 190    SCNCLR
  26. 195    '******* Set up our constants
  27. 200    M=3.141593/180:Xmax%=640:Ymax%=200
  28. 205    '******* and entering variables
  29. 210    color%=3:inkey$=""
  30. 215    '******* MAIN LOOP
  31. 220    WHILE inkey$=""
  32. 230    angle1=INT(121*RND)+59:increment=(INT(4*RND)+1)/2
  33. 240    px=INT(Xmax%/2):py=INT(Ymax%/2):angle2=angle1:p=increment:y=1
  34. 250    LOCATE (px,py)
  35. 255    '******* DRAW LOOP
  36. 260    WHILE y>0 AND y<Ymax%
  37. 270    x=2*p*COS(M*angle2)+px:y=p*SIN(M*angle2)+py
  38. 280    DRAW (TO x,y),Color%
  39. 290    p=p+increment:angle2=angle2+angle1:px=x:py=y
  40. 300    color%=color%+1:IF color%=16 THEN color%=3
  41. 310    WEND   'end draw loop
  42. 315    '******* blank the picture
  43. 320    FOR register%=3 to 15:RGB register%,0,0,0:NEXT register%
  44. 325    '******* pick a color
  45. 330    r%=INT(15*RND+1):g%=INT(15*RND+1):b%=INT(15*RND+1)
  46. 335    'Start to spin the pinwheel
  47. 340    FOR spins%=1 TO 10
  48. 350    FOR register%=3 to 15
  49. 360    RGB register%,r%,g%,b%
  50. 370    FOR delay%=1 to 50:NEXT delay%
  51. 380    RGB register%,0,0,0
  52. 390    NEXT register%
  53. 400    NEXT spins%
  54. 405    '******* end of spin
  55. 410    SCNCLR
  56. 415    '******* restore colors to registers 3-15
  57. 420    FOR register%=3 TO 15
  58. 430    RGB register%,red%(register%),green%(register%),blue%(register%)
  59. 440    NEXT register%
  60. 445    '******* pole the keyboard for inkey$
  61. 450    GET inkey$
  62. 460    WEND     'end main loop
  63. 465    '******* if a key was pressed we are out. restore register 0
  64. 466    '******* also restore register 2 [:RGB 2,red%(2),green%(2),blue%(2)]
  65. 466    '******* if you tinkered with it.
  66. 470    RGB 0,red%(0),green%(0),blue%(0)
  67. 480    END
  68. 490    'Pinwheels.bas
  69. 500    'Originally hacked for the Tandy 2000  1/85
  70. 510    'Rehacked for the Amiga(ABasiC)       10/25/85
  71. 520    'Dennis Brunskill     72746,1424
  72. 530    '
  73. 540    'BE SURE to exit the program by pressing a key and wait a bit
  74. 550    'otherwise you'll be typing in the dark. -=DB=-
  75.